<html>
  <head>
    <title>ConArtist Design Overview</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
  </head>
  <body>
    <div id="document">
      <div id="header">
        <h1>ConArtist Design Overview</h1>
        <ul>
          <li><a href="index.html">Home</a></li>
          <li>Design Documentation</li>
          <li><a href="started.html">Getting Started</a></li>
          <li><a href="api/">API Documentation</a></li>
        </ul>
      </div>
      <div id="content">
    <p class="centred">
      <img src="graphics/overview.png" align="center"/>
    </p>
    <h2>Central Facilities</h2>
<p>A number of services will be provided by the "core". These include</p>
<ul>
  <li>configuration processing</li>
  <li>module loading/unloading</li>
  <li>logging</li>
  <li>session key generation/management</li>
  <li>cache management</li>
  <li>url routing</li>
  <li>event scheduling</li>
  <li>housekeeping</li>
  <li>event processing</li>
</ul>
<p>This list is not definitive and may be added to as development proceeds.</p>
    <h2>One Library, Many Websites</h2>
    <p>When the library is initialised the config file(s) are read and the various websites that will be served are created. Each website is comprised of a number of pieces that are centrally managed.</p>
<h3><a href="generators.html">Content Generators</a></h3>
<p>The top level objects within the library are content generators. Each of these contains</p>
<ul>
  <li>configuration information</li>
  <li>data store(s)</li>
  <li>cache</li>
  <li>url creation maps</li>
</ul>
<h3>Stores</h3>
<p>Files for all aspects of the websites are contained in "stores". Each store is defined in the configuration and as many as required can be defined. Presently it is expected that stores may be</p>
<ul>
  <li>on disk directory/file structure</li>
  <li>local (on disk) SVN repository</li>
  <li>remote SVN repository</li>
</ul>
<p>Regardless of the storage used for the store the "raw files" from the store will be copied to the machine and updated as required.</p>
<h3>Hostname Map</h3>
<p>This is currently envisaged as a hash table that allows the library to quickly find the correct website from the hostname of the request. Ths allows a single website to be served from multiple hostnames.</p>
<h3>URL Mapping</h3>
<p>Once the hostname has found the website generator that should handle the request, the hostname and URL are used to find out which page should be returned. This process can lead to a page being generated, served from an existing file or an error returned.</p>
<p>The mapping process allows a single website generator to handle multiple "sections" of a website from a single generator.</p>
<p class="italic">e.g. The website generator "foo" has 3 sections, one for simple http requests, one for people who have registered to edit their details served via https and finally an administration section to control the websites. These are all served from the same server via vhost sections and are all handled by the same generator. The mapping allows each section to have it's own index.html, each unique to the section.</p>
<h3><a href="pages.html">Page Creation</a></h3>
<p>Each generator is responsible for creating it's own pages via whichever mechanism it requires. It is hoped that we will allow various templating systems to be used and arrive at a sensible way to define within the configuration file the logic needed to create each page.</p>
<h2>Intelligent Cache</h2>
<p>Integrating a cache into the library will allow a degree of intelligent caching to be used. Cache entries will be linked to the files that are used to create them.</p>
<p>All entries will be served from the cache if possible and generated pages will normally be stored in the cache (unless they are purely dynamic). If the content is not present in the cache then it will be generated and then inserted into the cache.</p>
<p>Entries will be cleaned when any of those files are updated instead of using a simple time based expiration as conventional cache systems do. The linkages need to be defined to try and prevent excessive checking and attempts to remove entries that no longer exist.</p>
      </div>
      <div id="footer">
        <p>&copy; 2007</p>
      </div>
    </div>
  </body>
</html>
